// components/tabbar/tabbar.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    activeTab: {
      type: String,
      value: 'home'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    active: 'home',
    list: [
      {
        pagePath: '/pages/home/home',
        text: '首页',
        name: 'home',
        activeIcon: '/static/icon/tabbar/home.png',
        inactiveIcon: '/static/icon/tabbar/home_sel.png',
        dot: false
      },
      {
        pagePath: '/pages/classify/classify',
        text: '分类',
        name: 'classify',
        activeIcon: '/static/icon/tabbar/classify.png',
        inactiveIcon: '/static/icon/tabbar/classify_sel.png',
        dot: false
      },
      {
        pagePath: '/pages/find/find',
        text: '发现',
        name: 'find',
        activeIcon: '/static/icon/tabbar/find.png',
        inactiveIcon: '/static/icon/tabbar/find_sel.png',
        dot: false
      },
      {
        pagePath: '/pages/mine/mine',
        text: '我的',
        name: 'mine',
        activeIcon: '/static/icon/tabbar/mine.png',
        inactiveIcon: '/static/icon/tabbar/mine_sel.png',
        dot: true
      }
    ]
  },
  /**
   * 组件的方法列表
   */
  methods: {
    onChange(e) {
      wx.switchTab({
        url: '/pages/' + e.detail + '/' + e.detail
      })
    }
  }
})
